package com.shop2cn.iapi.sqsynctrade.paremeter.mongo.details;

import java.util.Date;
import java.util.List;

import org.springframework.data.mongodb.core.mapping.Field;

import com.ymttest.database.model.annotation.Column;
import com.ymttest.database.model.annotation.Table;

/**
 * 物流信息
 */
public class Delivery {

	/**
	 * dlv
	 * 更新时间
	 */
	@Table("Ymt_Order_Frozen")
	@Column("dUpdateTime")
	@Field("upTm")
	private Date updateTime;

	/**
	 * dlv
	 * 冻结时间
	 */
	@Table("Ymt_Order_Frozen")
	@Column("dFrozenTime")
	@Field("fzTm")
	private Date frozenTime;

	/**
	 * dlv
	 * 暂停时间
	 */
	@Table("Ymt_Order_Frozen")
	@Column("bPause")
	@Field("pz")
	private boolean pause;

	/**
	 * dlv
	 * 业务类型
	 */
	@Table("Ymt_OrderFrozenDetail")
	@Column("BusynessTypes")
	@Field("bizTp")
	private List<String> bizType;

	/**
	 * dlv
	 * 延迟用户ID
	 */
	@Table("Ymt_Order_Frozen")
	@Column("iUserId")
	@Field("delayUser")
	private Long delayUserId;

	/**
	 * dlv
	 * 物流单号
	 */
	@Table("Ymt_BillCodeSummary")
	@Column("BillCode")
	@Field("dlvCode")
	private List<String> billCode;

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getFrozenTime() {
		return frozenTime;
	}

	public void setFrozenTime(Date frozenTime) {
		this.frozenTime = frozenTime;
	}

	public boolean isPause() {
		return pause;
	}

	public void setPause(boolean pause) {
		this.pause = pause;
	}

	public List<String> getBizType() {
		return bizType;
	}

	public void setBizType(List<String> bizType) {
		this.bizType = bizType;
	}

	public Long getDelayUserId() {
		return delayUserId;
	}

	public void setDelayUserId(Long delayUserId) {
		this.delayUserId = delayUserId;
	}

	public List<String> getBillCode() {
		return billCode;
	}

	public void setBillCode(List<String> billCode) {
		this.billCode = billCode;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (!(o instanceof Delivery))
			return false;

		Delivery delivery = (Delivery) o;

		if (isPause() != delivery.isPause())
			return false;
		if (getUpdateTime() != null ? !getUpdateTime().equals(
				delivery.getUpdateTime()) : delivery.getUpdateTime() != null)
			return false;
		if (getFrozenTime() != null ? !getFrozenTime().equals(
				delivery.getFrozenTime()) : delivery.getFrozenTime() != null)
			return false;
		if (getBizType() != null
				? !getBizType().equals(delivery.getBizType())
				: delivery.getBizType() != null)
			return false;
		if (getDelayUserId() != null ? !getDelayUserId().equals(
				delivery.getDelayUserId()) : delivery.getDelayUserId() != null)
			return false;
		return getBillCode() != null ? getBillCode().equals(
				delivery.getBillCode()) : delivery.getBillCode() == null;

	}

	@Override
	public int hashCode() {
		int result = getUpdateTime() != null ? getUpdateTime().hashCode() : 0;
		result = 31 * result
				+ (getFrozenTime() != null ? getFrozenTime().hashCode() : 0);
		result = 31 * result + (isPause() ? 1 : 0);
		result = 31 * result
				+ (getBizType() != null ? getBizType().hashCode() : 0);
		result = 31 * result
				+ (getDelayUserId() != null ? getDelayUserId().hashCode() : 0);
		result = 31 * result
				+ (getBillCode() != null ? getBillCode().hashCode() : 0);
		return result;
	}
}
